#!/bin/bash
#

while true
do
	read -p "请输入需要创建的用户名: " username
	
#判断用户是否存在
	if id $username	&> /dev/null;then
		echo "用户名已存在,请重新输入: "
		continue
	else
		useradd $username &> /dev/null
		read -p "请输入密码: " passwd
		exit 13
	fi			
done
